/**
 * 
 */
package com.swg.cocobox;

import java.nio.channels.SocketChannel;
import java.util.EventObject;

/**
 * Root class of all event state object shall be derived from this class.
 *  Event class has a specified {@link SocketChannel} reference, Therefore this class
 *   represent a communication event invoked through its {@link SocketChannel} reference.
 * @author satriaprayoga
 *
 */
public abstract class Event extends EventObject{
	private static final long serialVersionUID = 6355562717515945683L;

	private SocketChannel channel;
	
	protected Event(Object source) {
		super(source);
	}
	
	protected Event(Object source,SocketChannel channel) {
		this(source);
		this.channel=channel;
	}
	
	public void setChannel(SocketChannel channel) {
		this.channel = channel;
	}
	
	/**
	 * The {@link SocketChannel} reference
	 * @return
	 */
	public SocketChannel getChannel() {
		return channel;
	}

}
